#include <cstdio>

int d[1005];
int s[1005];

int max(int a,int b){
    return a > b ? a :b;
}
int main()
{
    //freopen("in.txt","r",stdin);
    int m,k;
    int maxs=0;
    scanf("%d%d",&m,&k);
    for(int i= 0 ;i < m;i++ )
        scanf("%d",&d[i]);
    for(int i= 0; i < m;i++)
        scanf("%d",&s[i]);
    long long fuel=0,res=0;
    for (int i=0;i<m;i++)
    {
        maxs=max(maxs,s[i]);
        fuel+=s[i]-d[i];
        res+=d[i];
        while (fuel < 0)
        {
            fuel+=maxs;
            res+=k;
        }

    }
    printf("%d",res);
}
